import org.junit.Test;

public class Mytest{
    @Test
    public void test1(){
        int[] arr={5,4,3,2,1};
        selectSorting(arr);
        for(int i:arr){
            System.out.print(i+" ");
        }
    }
    private void selectSorting(int[] arr){
        int min;
        int idx;
        for(int i=0;i<arr.length;i++){
            min=arr[i];
            idx=i;
            for(int j=i+1;j<arr.length;j++){
                if(arr[j]<min){
                    min=arr[j];
                    idx=j;
                }
            }
            arr[idx]=arr[i];
            arr[i]=min;
        }
    }
}
